with Interfaces.C; use Interfaces.C;
with SDL_stdinc_h;
with System;
with Interfaces.C.Extensions;
with Interfaces.C.Strings;
limited with SDL_rwops_h;

package SDL_video_h is


  SDL_ALPHA_OPAQUE : constant := 255;  --  SDL_video.h:39
  SDL_ALPHA_TRANSPARENT : constant := 0;  --  SDL_video.h:40

  SDL_SWSURFACE : constant := 16#00000000#;  --  SDL_video.h:118
  SDL_HWSURFACE : constant := 16#00000001#;  --  SDL_video.h:119
  SDL_ASYNCBLIT : constant := 16#00000004#;  --  SDL_video.h:120

  SDL_ANYFORMAT : constant := 16#10000000#;  --  SDL_video.h:122
  SDL_HWPALETTE : constant := 16#20000000#;  --  SDL_video.h:123
  SDL_DOUBLEBUF : constant := 16#40000000#;  --  SDL_video.h:124
  SDL_FULLSCREEN : constant := 16#80000000#;  --  SDL_video.h:125
  SDL_OPENGL : constant := 16#00000002#;  --  SDL_video.h:126
  SDL_OPENGLBLIT : constant := 16#0000000A#;  --  SDL_video.h:127
  SDL_RESIZABLE : constant := 16#00000010#;  --  SDL_video.h:128
  SDL_NOFRAME : constant := 16#00000020#;  --  SDL_video.h:129

  SDL_HWACCEL : constant := 16#00000100#;  --  SDL_video.h:131
  SDL_SRCCOLORKEY : constant := 16#00001000#;  --  SDL_video.h:132
  SDL_RLEACCELOK : constant := 16#00002000#;  --  SDL_video.h:133
  SDL_RLEACCEL : constant := 16#00004000#;  --  SDL_video.h:134
  SDL_SRCALPHA : constant := 16#00010000#;  --  SDL_video.h:135
  SDL_PREALLOC : constant := 16#01000000#;  --  SDL_video.h:136
  --  arg-macro: function SDL_MUSTLOCK (surface)
  --    return surface.offset or else ((surface.flags and (SDL_HWSURFACEorSDL_ASYNCBLITorSDL_RLEACCEL)) != 0);

  SDL_YV12_OVERLAY : constant := 16#32315659#;  --  SDL_video.h:176
  SDL_IYUV_OVERLAY : constant := 16#56555949#;  --  SDL_video.h:177
  SDL_YUY2_OVERLAY : constant := 16#32595559#;  --  SDL_video.h:178
  SDL_UYVY_OVERLAY : constant := 16#59565955#;  --  SDL_video.h:179
  SDL_YVYU_OVERLAY : constant := 16#55595659#;  --  SDL_video.h:180

  SDL_LOGPAL : constant := 16#01#;  --  SDL_video.h:222
  SDL_PHYSPAL : constant := 16#02#;  --  SDL_video.h:223
  --  unsupported macro: SDL_AllocSurface SDL_CreateRGBSurface
  --  arg-macro: procedure SDL_LoadBMP (file)
  --    SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
  --  arg-macro: procedure SDL_SaveBMP (surface, file)
  --    SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
  --  unsupported macro: SDL_BlitSurface SDL_UpperBlit


  --

  -- Header file for access to the SDL raw framebuffer window
  -- Set up for C function definitions, even when using C++
  -- Transparency definitions: These define alpha as the opacity of a surface
  -- Useful data types
   type SDL_Rect is record
      x : aliased SDL_stdinc_h.Sint16;  -- SDL_video.h:44:9
      y : aliased SDL_stdinc_h.Sint16;  -- SDL_video.h:44:12
      w : aliased SDL_stdinc_h.Uint16;  -- SDL_video.h:45:9
      h : aliased SDL_stdinc_h.Uint16;  -- SDL_video.h:45:12
   end record;
   pragma Convention (C, SDL_Rect);  -- SDL_video.h:43:25

   type SDL_Color is record
      r : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:49:8
      g : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:50:8
      b : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:51:8
      unused : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:52:8
   end record;
   pragma Convention (C, SDL_Color);  -- SDL_video.h:48:26

   type SDL_Palette is record
      ncolors : aliased int;  -- SDL_video.h:57:12
      colors : access SDL_Color;  -- SDL_video.h:58:13
   end record;
   pragma Convention (C, SDL_Palette);  -- SDL_video.h:56:28

  -- Everything in the pixel format structure is read-only
   type SDL_PixelFormat is record
      palette : access SDL_Palette;  -- SDL_video.h:63:15
      BitsPerPixel : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:64:9
      BytesPerPixel : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:65:9
      Rloss : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:66:9
      Gloss : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:67:9
      Bloss : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:68:9
      Aloss : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:69:9
      Rshift : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:70:9
      Gshift : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:71:9
      Bshift : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:72:9
      Ashift : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:73:9
      Rmask : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:74:9
      Gmask : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:75:9
      Bmask : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:76:9
      Amask : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:77:9
      colorkey : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:80:9
      alpha : aliased SDL_stdinc_h.Uint8;  -- SDL_video.h:82:9
   end record;
   pragma Convention (C, SDL_PixelFormat);  -- SDL_video.h:62:32

  -- RGB color key information
  -- Alpha value information (per-surface alpha)
  -- This structure should be treated as read-only, except for 'pixels',
  --   which, if not NULL, contains the raw pixel data for the surface.
  --

   -- Read-only

   type Sdl_Surface_Type is record
      flags : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:89:9
      format : access SDL_PixelFormat;  -- SDL_video.h:90:19
      w : aliased int;  -- SDL_video.h:91:6
      h : aliased int;  -- SDL_video.h:91:9
      pitch : aliased SDL_stdinc_h.Uint16;  -- SDL_video.h:92:9
      pixels : System.Address;  -- SDL_video.h:93:8
      offset : aliased int;  -- SDL_video.h:94:6
      hwdata : System.Address;  -- SDL_video.h:97:25
      clip_rect : aliased SDL_Rect;  -- SDL_video.h:100:11
      unused1 : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:101:9
      locked : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:104:9
      map : System.Address;  -- SDL_video.h:107:22
      format_version : aliased unsigned;  -- SDL_video.h:110:15
      refcount : aliased int;  -- SDL_video.h:113:6
   end record;
   pragma Convention (C, Sdl_Surface_Type);  -- SDL_video.h:88:28

   type Sdl_Surface is access all Sdl_Surface_Type;
   pragma Convention (C, Sdl_Surface);


   type SDL_blit is access function
        (arg1 : Sdl_Surface;
         arg2 : access SDL_Rect;
         arg3 : Sdl_Surface;
         arg4 : access SDL_Rect) return int;  -- SDL_video.h:145:46

  -- Useful for determining the video hardware capabilities
  -- Flag: Can you create hardware surfaces?
   type SDL_VideoInfo is record
      hw_available : Extensions.Unsigned_1;  -- SDL_video.h:150:23
      wm_available : Extensions.Unsigned_1;  -- SDL_video.h:151:23
      UnusedBits1 : Extensions.Unsigned_6;  -- SDL_video.h:152:23
      UnusedBits2 : Extensions.Unsigned_1;  -- SDL_video.h:153:23
      blit_hw : Extensions.Unsigned_1;  -- SDL_video.h:154:23
      blit_hw_CC : Extensions.Unsigned_1;  -- SDL_video.h:155:23
      blit_hw_A : Extensions.Unsigned_1;  -- SDL_video.h:156:23
      blit_sw : Extensions.Unsigned_1;  -- SDL_video.h:157:23
      blit_sw_CC : Extensions.Unsigned_1;  -- SDL_video.h:158:23
      blit_sw_A : Extensions.Unsigned_1;  -- SDL_video.h:159:23
      blit_fill : Extensions.Unsigned_1;  -- SDL_video.h:160:23
      UnusedBits3 : aliased unsigned_short;  -- SDL_video.h:161:23
      video_mem : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:162:9
      vfmt : access SDL_PixelFormat;  -- SDL_video.h:163:19
      current_w : aliased int;  -- SDL_video.h:164:9
      current_h : aliased int;  -- SDL_video.h:165:9
   end record;
   pragma Convention (C, SDL_VideoInfo);
   pragma Pack (SDL_VideoInfo);  -- SDL_video.h:149:30


  -- The YUV hardware video overlay
  -- Read-only
   type SDL_Overlay is record
      format : aliased SDL_stdinc_h.Uint32;  -- SDL_video.h:184:9
      w : aliased int;  -- SDL_video.h:185:6
      h : aliased int;  -- SDL_video.h:185:9
      planes : aliased int;  -- SDL_video.h:186:6
      pitches : access SDL_stdinc_h.Uint16;  -- SDL_video.h:187:10
      pixels : System.Address;  -- SDL_video.h:188:10
      hwfuncs : System.Address;  -- SDL_video.h:191:29
      hwdata : System.Address;  -- SDL_video.h:192:28
      hw_overlay : Extensions.Unsigned_1;  -- SDL_video.h:195:21
      UnusedBits : Extensions.Unsigned_31;  -- SDL_video.h:196:21
   end record;
   pragma Convention (C, SDL_Overlay);
   pragma Pack (SDL_Overlay);  -- SDL_video.h:183:28


  -- Special flags
  -- Flag: This overlay hardware accelerated?
  -- Public enumeration for setting the OpenGL window attributes.
   subtype SDL_GLattr is unsigned;
   SDL_GL_RED_SIZE : constant SDL_GLattr := 0;
   SDL_GL_GREEN_SIZE : constant SDL_GLattr := 1;
   SDL_GL_BLUE_SIZE : constant SDL_GLattr := 2;
   SDL_GL_ALPHA_SIZE : constant SDL_GLattr := 3;
   SDL_GL_BUFFER_SIZE : constant SDL_GLattr := 4;
   SDL_GL_DOUBLEBUFFER : constant SDL_GLattr := 5;
   SDL_GL_DEPTH_SIZE : constant SDL_GLattr := 6;
   SDL_GL_STENCIL_SIZE : constant SDL_GLattr := 7;
   SDL_GL_ACCUM_RED_SIZE : constant SDL_GLattr := 8;
   SDL_GL_ACCUM_GREEN_SIZE : constant SDL_GLattr := 9;
   SDL_GL_ACCUM_BLUE_SIZE : constant SDL_GLattr := 10;
   SDL_GL_ACCUM_ALPHA_SIZE : constant SDL_GLattr := 11;
   SDL_GL_STEREO : constant SDL_GLattr := 12;
   SDL_GL_MULTISAMPLEBUFFERS : constant SDL_GLattr := 13;
   SDL_GL_MULTISAMPLESAMPLES : constant SDL_GLattr := 14;
   SDL_GL_ACCELERATED_VISUAL : constant SDL_GLattr := 15;
   SDL_GL_SWAP_CONTROL : constant SDL_GLattr := 16;  -- SDL_video.h:219:3

  -- flags for SDL_SetPalette()
  -- Function prototypes
  -- These functions are used internally, and should not be used unless you
  -- * have a specific need to specify the video driver you want to use.
  -- * You should normally use SDL_Init() or SDL_InitSubSystem().
  -- *
  -- * SDL_VideoInit() initializes the video subsystem -- sets up a connection
  -- * to the window manager, etc, and determines the current video mode and
  -- * pixel format, but does not initialize a window or graphics mode.
  -- * Note that event handling is activated by this routine.
  -- *
  -- * If you use both sound and video in your application, you need to call
  -- * SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
  -- * you won't be able to set full-screen display modes.
  --

   function SDL_VideoInit (driver_name : Interfaces.C.Strings.chars_ptr; flags : SDL_stdinc_h.Uint32) return int;  -- SDL_video.h:240:80
   pragma Import (C, SDL_VideoInit, "SDL_VideoInit");

   procedure SDL_VideoQuit;  -- SDL_video.h:241:48
   pragma Import (C, SDL_VideoQuit, "SDL_VideoQuit");

  -- This function fills the given character buffer with the name of the
  -- * video driver, and returns a pointer to it if the video driver has
  -- * been initialized.  It returns NULL if no driver has been initialized.
  --

   function SDL_VideoDriverName (namebuf : Interfaces.C.Strings.chars_ptr; maxlen : int) return Interfaces.C.Strings.chars_ptr;  -- SDL_video.h:247:77
   pragma Import (C, SDL_VideoDriverName, "SDL_VideoDriverName");

  -- * This function returns a pointer to the current display surface.
  -- * If SDL is doing format conversion on the display surface, this
  -- * function returns the publicly visible surface, not the real video
  -- * surface.
  --

   function SDL_GetVideoSurface return Sdl_Surface;  -- SDL_video.h:255:63
   pragma Import (C, SDL_GetVideoSurface, "SDL_GetVideoSurface");

  -- * This function returns a read-only pointer to information about the
  -- * video hardware.  If this is called before SDL_SetVideoMode(), the 'vfmt'
  -- * member of the returned structure will contain the pixel format of the
  -- * "best" video mode.
  --

   function SDL_GetVideoInfo return access constant SDL_VideoInfo;  -- SDL_video.h:263:68
   pragma Import (C, SDL_GetVideoInfo, "SDL_GetVideoInfo");

  --
  -- * Check to see if a particular video mode is supported.
  -- * It returns 0 if the requested mode is not supported under any bit depth,
  -- * or returns the bits-per-pixel of the closest available mode with the
  -- * given width and height.  If this bits-per-pixel is different from the
  -- * one used when setting the video mode, SDL_SetVideoMode() will succeed,
  -- * but will emulate the requested bits-per-pixel with a shadow surface.
  -- *
  -- * The arguments to SDL_VideoModeOK() are the same ones you would pass to
  -- * SDL_SetVideoMode()
  --

   function SDL_VideoModeOK
     (width : int;
      height : int;
      bpp : int;
      flags : SDL_stdinc_h.Uint32) return int;  -- SDL_video.h:276:89
   pragma Import (C, SDL_VideoModeOK, "SDL_VideoModeOK");

  -- * Return a pointer to an array of available screen dimensions for the
  -- * given format and video flags, sorted largest to smallest.  Returns
  -- * NULL if there are no dimensions available for a particular format,
  -- * or (SDL_Rect **)-1 if any dimension is okay for the given format.
  -- *
  -- * If 'format' is NULL, the mode list will be for the format given
  -- * by SDL_GetVideoInfo()->vfmt
  --

   function SDL_ListModes (format : access SDL_PixelFormat; flags : SDL_stdinc_h.Uint32) return System.Address;  -- SDL_video.h:287:88
   pragma Import (C, SDL_ListModes, "SDL_ListModes");


   function SDL_SetVideoMode
     (width : int;
      height : int;
      bpp : int;
      flags : SDL_stdinc_h.Uint32) return Sdl_Surface;  -- SDL_video.h:348:49
   pragma Import (C, SDL_SetVideoMode, "SDL_SetVideoMode");

  -- * Makes sure the given list of rectangles is updated on the given screen.
  -- * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
  -- * screen.
  -- * These functions should not be called while 'screen' is locked.
  --

   procedure SDL_UpdateRects
     (screen : Sdl_Surface;
      numrects : int;
      rects : access SDL_Rect);  -- SDL_video.h:357:54
   pragma Import (C, SDL_UpdateRects, "SDL_UpdateRects");

   procedure SDL_UpdateRect
     (screen : Sdl_Surface;
      x : SDL_stdinc_h.Sint32;
      y : SDL_stdinc_h.Sint32;
      w : SDL_stdinc_h.Uint32;
      h : SDL_stdinc_h.Uint32);  -- SDL_video.h:359:63
   pragma Import (C, SDL_UpdateRect, "SDL_UpdateRect");

  -- * On hardware that supports double-buffering, this function sets up a flip
  -- * and returns.  The hardware will wait for vertical retrace, and then swap
  -- * video buffers before the next video surface blit or lock will return.
  -- * On hardware that doesn not support double-buffering, this is equivalent
  -- * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
  -- * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
  -- * setting the video mode for this function to perform hardware flipping.
  -- * This function returns 0 if successful, or -1 if there was an error.
  --

   function SDL_Flip (screen : Sdl_Surface) return int;  -- SDL_video.h:371:57
   pragma Import (C, SDL_Flip, "SDL_Flip");

  -- * Set the gamma correction for each of the color channels.
  -- * The gamma values range (approximately) between 0.1 and 10.0
  -- *
  -- * If this function isn't supported directly by the hardware, it will
  -- * be emulated using gamma ramps, if available.  If successful, this
  -- * function returns 0, otherwise it returns -1.
  --

   function SDL_SetGamma
     (red : long_float;
      green : long_float;
      blue : long_float) return int;  -- SDL_video.h:381:76
   pragma Import (C, SDL_SetGamma, "SDL_SetGamma");

  -- * Set the gamma translation table for the red, green, and blue channels
  -- * of the video hardware.  Each table is an array of 256 16-bit quantities,
  -- * representing a mapping between the input and output for that channel.
  -- * The input is the index into the array, and the output is the 16-bit
  -- * gamma value at that index, scaled to the output color precision.
  -- *
  -- * You may pass NULL for any of the channels to leave it unchanged.
  -- * If the call succeeds, it will return 0.  If the display driver or
  -- * hardware does not support gamma translation, or otherwise fails,
  -- * this function will return -1.
  --

   function SDL_SetGammaRamp
     (red : access SDL_stdinc_h.Uint16;
      green : access SDL_stdinc_h.Uint16;
      blue : access SDL_stdinc_h.Uint16) return int;  -- SDL_video.h:395:104
   pragma Import (C, SDL_SetGammaRamp, "SDL_SetGammaRamp");

  -- * Retrieve the current values of the gamma translation tables.
  -- *
  -- * You must pass in valid pointers to arrays of 256 16-bit quantities.
  -- * Any of the pointers may be NULL to ignore that channel.
  -- * If the call succeeds, it will return 0.  If the display driver or
  -- * hardware does not support gamma translation, or otherwise fails,
  -- * this function will return -1.
  --

   function SDL_GetGammaRamp
     (red : access SDL_stdinc_h.Uint16;
      green : access SDL_stdinc_h.Uint16;
      blue : access SDL_stdinc_h.Uint16) return int;  -- SDL_video.h:406:86
   pragma Import (C, SDL_GetGammaRamp, "SDL_GetGammaRamp");

  -- * Sets a portion of the colormap for the given 8-bit surface.  If 'surface'
  -- * is not a palettized surface, this function does nothing, returning 0.
  -- * If all of the colors were set as passed to SDL_SetColors(), it will
  -- * return 1.  If not all the color entries were set exactly as given,
  -- * it will return 0, and you should look at the surface palette to
  -- * determine the actual color palette.
  -- *
  -- * When 'surface' is the surface associated with the current display, the
  -- * display colormap will be updated with the requested colors.  If
  -- * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
  -- * will always return 1, and the palette is guaranteed to be set the way
  -- * you desire, even if the window colormap has to be warped or run under
  -- * emulation.
  --

   function SDL_SetColors
     (surface : Sdl_Surface;
      colors : access SDL_Color;
      firstcolor : int;
      ncolors : int) return int;  -- SDL_video.h:424:50
   pragma Import (C, SDL_SetColors, "SDL_SetColors");

  -- * Sets a portion of the colormap for a given 8-bit surface.
  -- * 'flags' is one or both of:
  -- * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
  -- *                to/from the surface,
  -- * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
  -- *                the screen
  -- * Only screens have physical palettes. Separate change of physical/logical
  -- * palettes is only possible if the screen has SDL_HWPALETTE set.
  -- *
  -- * The return value is 1 if all colours could be set as requested, and 0
  -- * otherwise.
  -- *
  -- * SDL_SetColors() is equivalent to calling this function with
  -- *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
  --

   function SDL_SetPalette
     (surface : Sdl_Surface;
      flags : int;
      colors : access SDL_Color;
      firstcolor : int;
      ncolors : int) return int;  -- SDL_video.h:444:19
   pragma Import (C, SDL_SetPalette, "SDL_SetPalette");

  -- * Maps an RGB triple to an opaque pixel value for a given pixel format
  --

   function SDL_MapRGB
     (format : access constant SDL_PixelFormat;
      r : SDL_stdinc_h.Uint8;
      g : SDL_stdinc_h.Uint8;
      b : SDL_stdinc_h.Uint8) return SDL_stdinc_h.Uint32;  -- SDL_video.h:451:45
   pragma Import (C, SDL_MapRGB, "SDL_MapRGB");

  -- * Maps an RGBA quadruple to a pixel value for a given pixel format
  --

   function SDL_MapRGBA
     (format : access constant SDL_PixelFormat;
      r : SDL_stdinc_h.Uint8;
      g : SDL_stdinc_h.Uint8;
      b : SDL_stdinc_h.Uint8;
      a : SDL_stdinc_h.Uint8) return SDL_stdinc_h.Uint32;  -- SDL_video.h:458:60
   pragma Import (C, SDL_MapRGBA, "SDL_MapRGBA");

  -- * Maps a pixel value into the RGB components for a given pixel format
  --

   procedure SDL_GetRGB
     (pixel : SDL_stdinc_h.Uint32;
      fmt : access SDL_PixelFormat;
      r : access SDL_stdinc_h.Uint8;
      g : access SDL_stdinc_h.Uint8;
      b : access SDL_stdinc_h.Uint8);  -- SDL_video.h:464:33
   pragma Import (C, SDL_GetRGB, "SDL_GetRGB");

  -- * Maps a pixel value into the RGBA components for a given pixel format
  --

   procedure SDL_GetRGBA
     (pixel : SDL_stdinc_h.Uint32;
      fmt : access SDL_PixelFormat;
      r : access SDL_stdinc_h.Uint8;
      g : access SDL_stdinc_h.Uint8;
      b : access SDL_stdinc_h.Uint8;
      a : access SDL_stdinc_h.Uint8);  -- SDL_video.h:470:44
   pragma Import (C, SDL_GetRGBA, "SDL_GetRGBA");

  -- * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
  -- * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
  -- * If the depth is greater than 8 bits, the pixel format is set using the
  -- * flags '[RGB]mask'.
  -- * If the function runs out of memory, it will return NULL.
  -- *
  -- * The 'flags' tell what kind of surface to create.
  -- * SDL_SWSURFACE means that the surface should be created in system memory.
  -- * SDL_HWSURFACE means that the surface should be created in video memory,
  -- * with the same format as the display surface.  This is useful for surfaces
  -- * that will not change much, to take advantage of hardware acceleration
  -- * when being blitted to the display surface.
  -- * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
  -- * this surface, but you must always lock it before accessing the pixels.
  -- * SDL will wait for current blits to finish before returning from the lock.
  -- * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
  -- * If the hardware supports acceleration of colorkey blits between
  -- * two surfaces in video memory, SDL will try to place the surface in
  -- * video memory. If this isn't possible or if there is no hardware
  -- * acceleration available, the surface will be placed in system memory.
  -- * SDL_SRCALPHA means that the surface will be used for alpha blits and
  -- * if the hardware supports hardware acceleration of alpha blits between
  -- * two surfaces in video memory, to place the surface in video memory
  -- * if possible, otherwise it will be placed in system memory.
  -- * If the surface is created in video memory, blits will be _much_ faster,
  -- * but the surface format must be identical to the video surface format,
  -- * and the only way to access the pixels member of the surface is to use
  -- * the SDL_LockSurface() and SDL_UnlockSurface() calls.
  -- * If the requested surface actually resides in video memory, SDL_HWSURFACE
  -- * will be set in the flags member of the returned surface.  If for some
  -- * reason the surface could not be placed in video memory, it will not have
  -- * the SDL_HWSURFACE flag set, and will be created in system memory instead.
  --

   function SDL_CreateRGBSurface
     (flags : SDL_stdinc_h.Uint32;
      width : int;
      height : int;
      depth : int;
      Rmask : SDL_stdinc_h.Uint32;
      Gmask : SDL_stdinc_h.Uint32;
      Bmask : SDL_stdinc_h.Uint32;
      Amask : SDL_stdinc_h.Uint32) return Sdl_Surface;  -- SDL_video.h:509:58
   pragma Import (C, SDL_CreateRGBSurface, "SDL_CreateRGBSurface");

   function SDL_CreateRGBSurfaceFrom
     (pixels : System.Address;
      width : int;
      height : int;
      depth : int;
      pitch : int;
      Rmask : SDL_stdinc_h.Uint32;
      Gmask : SDL_stdinc_h.Uint32;
      Bmask : SDL_stdinc_h.Uint32;
      Amask : SDL_stdinc_h.Uint32) return Sdl_Surface;  -- SDL_video.h:512:58
   pragma Import (C, SDL_CreateRGBSurfaceFrom, "SDL_CreateRGBSurfaceFrom");

   procedure SDL_FreeSurface (surface : Sdl_Surface);  -- SDL_video.h:513:66
   pragma Import (C, SDL_FreeSurface, "SDL_FreeSurface");

  -- * SDL_LockSurface() sets up a surface for directly accessing the pixels.
  -- * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
  -- * to and read from 'surface->pixels', using the pixel format stored in
  -- * 'surface->format'.  Once you are done accessing the surface, you should
  -- * use SDL_UnlockSurface() to release it.
  -- *
  -- * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
  -- * to 0, then you can read and write to the surface at any time, and the
  -- * pixel format of the surface will not change.  In particular, if the
  -- * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
  -- * will not need to lock the display surface before accessing it.
  -- *
  -- * No operating system or library calls should be made between lock/unlock
  -- * pairs, as critical system locks may be held during this time.
  -- *
  -- * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
  --

   function SDL_LockSurface (surface : Sdl_Surface) return int;  -- SDL_video.h:533:65
   pragma Import (C, SDL_LockSurface, "SDL_LockSurface");

   procedure SDL_UnlockSurface (surface : Sdl_Surface);  -- SDL_video.h:534:68
   pragma Import (C, SDL_UnlockSurface, "SDL_UnlockSurface");

  -- * Load a surface from a seekable SDL data source (memory or file.)
  -- * If 'freesrc' is non-zero, the source will be closed after being read.
  -- * Returns the new surface, or NULL if there was an error.
  -- * The new surface should be freed with SDL_FreeSurface().
  --

   function SDL_LoadBMP_RW (src : access SDL_rwops_h.SDL_RWops; freesrc : int) return Sdl_Surface;  -- SDL_video.h:542:81
   pragma Import (C, SDL_LoadBMP_RW, "SDL_LoadBMP_RW");

  -- Convenience macro -- load a surface from a file
  -- * Save a surface to a seekable SDL data source (memory or file.)
  -- * If 'freedst' is non-zero, the source will be closed after being written.
  -- * Returns 0 if successful or -1 if there was an error.
  --

   function SDL_SaveBMP_RW
     (surface : Sdl_Surface;
      dst : access SDL_rwops_h.SDL_RWops;
      freedst : int) return int;  -- SDL_video.h:553:53
   pragma Import (C, SDL_SaveBMP_RW, "SDL_SaveBMP_RW");

  -- Convenience macro -- save a surface to a file
  -- * Sets the color key (transparent pixel) in a blittable surface.
  -- * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
  -- * 'key' will be the transparent pixel in the source image of a blit.
  -- * SDL_RLEACCEL requests RLE acceleration for the surface if present,
  -- * and removes RLE acceleration if absent.
  -- * If 'flag' is 0, this function clears any current color key.
  -- * This function returns 0, or -1 if there was an error.
  --

   function SDL_SetColorKey
     (surface : Sdl_Surface;
      flag : SDL_stdinc_h.Uint32;
      key : SDL_stdinc_h.Uint32) return int;  -- SDL_video.h:569:50
   pragma Import (C, SDL_SetColorKey, "SDL_SetColorKey");

  -- * This function sets the alpha value for the entire surface, as opposed to
  -- * using the alpha component of each pixel. This value measures the range
  -- * of transparency of the surface, 0 being completely transparent to 255
  -- * being completely opaque. An 'alpha' value of 255 causes blits to be
  -- * opaque, the source pixels copied to the destination (the default). Note
  -- * that per-surface alpha can be combined with colorkey transparency.
  -- *
  -- * If 'flag' is 0, alpha blending is disabled for the surface.
  -- * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
  -- * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
  -- * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
  -- *
  -- * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
  --

   function SDL_SetAlpha
     (surface : Sdl_Surface;
      flag : SDL_stdinc_h.Uint32;
      alpha : SDL_stdinc_h.Uint8) return int;  -- SDL_video.h:586:88
   pragma Import (C, SDL_SetAlpha, "SDL_SetAlpha");

  -- * Sets the clipping rectangle for the destination surface in a blit.
  -- *
  -- * If the clip rectangle is NULL, clipping will be disabled.
  -- * If the clip rectangle doesn't intersect the surface, the function will
  -- * return SDL_FALSE and blits will be completely clipped.  Otherwise the
  -- * function returns SDL_TRUE and blits to the surface will be clipped to
  -- * the intersection of the surface area and the clipping rectangle.
  -- *
  -- * Note that blits are automatically clipped to the edges of the source
  -- * and destination surfaces.
  --

   function SDL_SetClipRect (surface : Sdl_Surface; rect : access constant SDL_Rect) return SDL_stdinc_h.SDL_bool;  -- SDL_video.h:600:92
   pragma Import (C, SDL_SetClipRect, "SDL_SetClipRect");

  -- * Gets the clipping rectangle for the destination surface in a blit.
  -- * 'rect' must be a pointer to a valid rectangle which will be filled
  -- * with the correct values.
  --

   procedure SDL_GetClipRect (surface : Sdl_Surface; rect : access SDL_Rect);  -- SDL_video.h:607:82
   pragma Import (C, SDL_GetClipRect, "SDL_GetClipRect");

  -- * Creates a new surface of the specified format, and then copies and maps
  -- * the given surface to it so the blit of the converted surface will be as
  -- * fast as possible.  If this function fails, it returns NULL.
  -- *
  -- * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
  -- * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
  -- * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
  -- * surface.
  -- *
  -- * This function is used internally by SDL_DisplayFormat().
  --

   function SDL_ConvertSurface
     (src : Sdl_Surface;
      fmt : access SDL_PixelFormat;
      flags : SDL_stdinc_h.Uint32) return Sdl_Surface;  -- SDL_video.h:622:57
   pragma Import (C, SDL_ConvertSurface, "SDL_ConvertSurface");

  -- * This performs a fast blit from the source surface to the destination
  -- * surface.  It assumes that the source and destination rectangles are
  -- * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
  -- * surface (src or dst) is copied.  The final blit rectangles are saved
  -- * in 'srcrect' and 'dstrect' after all clipping is performed.
  -- * If the blit is successful, it returns 0, otherwise it returns -1.
  -- *
  -- * The blit function should not be called on a locked surface.
  -- *
  -- * The blit semantics for surfaces with and without alpha and colorkey
  -- * are defined as follows:
  -- *
  -- * RGBA->RGB:
  -- *     SDL_SRCALPHA set:
  -- * 	alpha-blend (using alpha-channel).
  -- * 	SDL_SRCCOLORKEY ignored.
  -- *     SDL_SRCALPHA not set:
  -- * 	copy RGB.
  -- * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  -- * 	RGB values of the source colour key, ignoring alpha in the
  -- * 	comparison.
  -- *
  -- * RGB->RGBA:
  -- *     SDL_SRCALPHA set:
  -- * 	alpha-blend (using the source per-surface alpha value);
  -- * 	set destination alpha to opaque.
  -- *     SDL_SRCALPHA not set:
  -- * 	copy RGB, set destination alpha to source per-surface alpha value.
  -- *     both:
  -- * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  -- * 	source colour key.
  -- *
  -- * RGBA->RGBA:
  -- *     SDL_SRCALPHA set:
  -- * 	alpha-blend (using the source alpha channel) the RGB values;
  -- * 	leave destination alpha untouched. [Note: is this correct?]
  -- * 	SDL_SRCCOLORKEY ignored.
  -- *     SDL_SRCALPHA not set:
  -- * 	copy all of RGBA to the destination.
  -- * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  -- * 	RGB values of the source colour key, ignoring alpha in the
  -- * 	comparison.
  -- *
  -- * RGB->RGB:
  -- *     SDL_SRCALPHA set:
  -- * 	alpha-blend (using the source per-surface alpha value).
  -- *     SDL_SRCALPHA not set:
  -- * 	copy RGB.
  -- *     both:
  -- * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  -- * 	source colour key.
  -- *
  -- * If either of the surfaces were in video memory, and the blit returns -2,
  -- * the video memory was lost, so it should be reloaded with artwork and
  -- * re-blitted:
  --	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
  --		while ( SDL_LockSurface(image) < 0 )
  --			Sleep(10);
  --		-- Write image pixels to image->pixels --
  --		SDL_UnlockSurface(image);
  --	}
  -- * This happens under DirectX 5.0 when the system switches away from your
  -- * fullscreen application.  The lock will also fail until you have access
  -- * to the video memory again.
  --

  -- You should call SDL_BlitSurface() unless you know exactly how SDL
  --   blitting works internally and how to use the other blit functions.
  --

  -- This is the public blit function, SDL_BlitSurface(), and it performs
  --   rectangle validation and clipping before passing it to SDL_LowerBlit()
  --

   function SDL_UpperBlit
     (src : Sdl_Surface;
      srcrect : access SDL_Rect;
      dst : Sdl_Surface;
      dstrect : access SDL_Rect) return int;  -- SDL_video.h:700:40
   pragma Import (C, SDL_UpperBlit, "SDL_UpperBlit");

  -- This is a semi-private blit function and it performs low-level surface
  --   blitting only.
  --

   function SDL_LowerBlit
     (src : Sdl_Surface;
      srcrect : access SDL_Rect;
      dst : Sdl_Surface;
      dstrect : access SDL_Rect) return int;  -- SDL_video.h:706:40
   pragma Import (C, SDL_LowerBlit, "SDL_LowerBlit");

  -- * This function performs a fast fill of the given rectangle with 'color'
  -- * The given rectangle is clipped to the destination surface clip area
  -- * and the final fill rectangle is saved in the passed in pointer.
  -- * If 'dstrect' is NULL, the whole surface will be filled with 'color'
  -- * The color should be a pixel of the format used by the surface, and
  -- * can be generated by the SDL_MapRGB() function.
  -- * This function returns 0 on success, or -1 on error.
  --

   function SDL_FillRect
     (dst : Sdl_Surface;
      dstrect : access SDL_Rect;
      color : SDL_stdinc_h.Uint32) return int;  -- SDL_video.h:718:53
   pragma Import (C, SDL_FillRect, "SDL_FillRect");

  --
  -- * This function takes a surface and copies it to a new surface of the
  -- * pixel format and colors of the video framebuffer, suitable for fast
  -- * blitting onto the display surface.  It calls SDL_ConvertSurface()
  -- *
  -- * If you want to take advantage of hardware colorkey or alpha blit
  -- * acceleration, you should set the colorkey and alpha value before
  -- * calling this function.
  -- *
  -- * If the conversion fails or runs out of memory, it returns NULL
  --

   function SDL_DisplayFormat (surface : Sdl_Surface) return Sdl_Surface;  -- SDL_video.h:731:77
   pragma Import (C, SDL_DisplayFormat, "SDL_DisplayFormat");

  --
  -- * This function takes a surface and copies it to a new surface of the
  -- * pixel format and colors of the video framebuffer (if possible),
  -- * suitable for fast alpha blitting onto the display surface.
  -- * The new surface will always have an alpha channel.
  -- *
  -- * If you want to take advantage of hardware colorkey or alpha blit
  -- * acceleration, you should set the colorkey and alpha value before
  -- * calling this function.
  -- *
  -- * If the conversion fails or runs out of memory, it returns NULL
  --

   function SDL_DisplayFormatAlpha (surface : Sdl_Surface) return Sdl_Surface;  -- SDL_video.h:745:82
   pragma Import (C, SDL_DisplayFormatAlpha, "SDL_DisplayFormatAlpha");

  -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  -- YUV video surface overlay functions
  -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  -- This function creates a video output overlay
  --   Calling the returned surface an overlay is something of a misnomer because
  --   the contents of the display surface underneath the area where the overlay
  --   is shown is undefined - it may be overwritten with the converted YUV data.
  --

   function SDL_CreateYUVOverlay
     (width : int;
      height : int;
      format : SDL_stdinc_h.Uint32;
      display : Sdl_Surface) return access SDL_Overlay;  -- SDL_video.h:758:40
   pragma Import (C, SDL_CreateYUVOverlay, "SDL_CreateYUVOverlay");

  -- Lock an overlay for direct access, and unlock it when you are done
   function SDL_LockYUVOverlay (overlay : access SDL_Overlay) return int;  -- SDL_video.h:761:68
   pragma Import (C, SDL_LockYUVOverlay, "SDL_LockYUVOverlay");

   procedure SDL_UnlockYUVOverlay (overlay : access SDL_Overlay);  -- SDL_video.h:762:71
   pragma Import (C, SDL_UnlockYUVOverlay, "SDL_UnlockYUVOverlay");

  -- Blit a video overlay to the display surface.
  --   The contents of the video surface underneath the blit destination are
  --   not defined.
  --   The width and height of the destination rectangle may be different from
  --   that of the overlay, but currently only 2x scaling is supported.
  --

   function SDL_DisplayYUVOverlay (overlay : access SDL_Overlay; dstrect : access SDL_Rect) return int;  -- SDL_video.h:770:90
   pragma Import (C, SDL_DisplayYUVOverlay, "SDL_DisplayYUVOverlay");

  -- Free a video overlay
   procedure SDL_FreeYUVOverlay (overlay : access SDL_Overlay);  -- SDL_video.h:773:69
   pragma Import (C, SDL_FreeYUVOverlay, "SDL_FreeYUVOverlay");

  -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  -- OpenGL support functions.
  -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  -- * Dynamically load an OpenGL library, or the default one if path is NULL
  -- *
  -- * If you do this, you need to retrieve all of the GL functions used in
  -- * your program from the dynamic library using SDL_GL_GetProcAddress().
  --

   function SDL_GL_LoadLibrary (path : Interfaces.C.Strings.chars_ptr) return int;  -- SDL_video.h:786:64
   pragma Import (C, SDL_GL_LoadLibrary, "SDL_GL_LoadLibrary");

  -- * Get the address of a GL function
  --

   function SDL_GL_GetProcAddress (proc : Interfaces.C.Strings.chars_ptr) return System.Address;  -- SDL_video.h:791:70
   pragma Import (C, SDL_GL_GetProcAddress, "SDL_GL_GetProcAddress");

  -- * Set an attribute of the OpenGL subsystem before intialization.
  --

   function SDL_GL_SetAttribute (attr : SDL_GLattr; value : int) return int;  -- SDL_video.h:796:75
   pragma Import (C, SDL_GL_SetAttribute, "SDL_GL_SetAttribute");

  -- * Get an attribute of the OpenGL subsystem from the windowing
  -- * interface, such as glX. This is of course different from getting
  -- * the values from SDL's internal OpenGL subsystem, which only
  -- * stores the values you request before initialization.
  -- *
  -- * Developers should track the values they pass into SDL_GL_SetAttribute
  -- * themselves if they want to retrieve these values.
  --

   function SDL_GL_GetAttribute (attr : SDL_GLattr; value : access int) return int;  -- SDL_video.h:807:76
   pragma Import (C, SDL_GL_GetAttribute, "SDL_GL_GetAttribute");

  -- * Swap the OpenGL buffers, if double-buffering is supported.
  --

   procedure SDL_GL_SwapBuffers;  -- SDL_video.h:812:53
   pragma Import (C, SDL_GL_SwapBuffers, "SDL_GL_SwapBuffers");

  -- * Internal functions that should not be called unless you have read
  -- * and understood the source code for these functions.
  --

   procedure SDL_GL_UpdateRects (numrects : int; rects : access SDL_Rect);  -- SDL_video.h:818:78
   pragma Import (C, SDL_GL_UpdateRects, "SDL_GL_UpdateRects");

   procedure SDL_GL_Lock;  -- SDL_video.h:819:46
   pragma Import (C, SDL_GL_Lock, "SDL_GL_Lock");

   procedure SDL_GL_Unlock;  -- SDL_video.h:820:48
   pragma Import (C, SDL_GL_Unlock, "SDL_GL_Unlock");

  -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  -- These functions allow interaction with the window manager, if any.
  -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  -- * Sets/Gets the title and icon text of the display window (UTF-8 encoded)
  --

   procedure SDL_WM_SetCaption (title : Interfaces.C.Strings.chars_ptr; icon : Interfaces.C.Strings.chars_ptr);  -- SDL_video.h:829:83
   pragma Import (C, SDL_WM_SetCaption, "SDL_WM_SetCaption");

   procedure SDL_WM_GetCaption (title : System.Address; icon : System.Address);  -- SDL_video.h:830:73
   pragma Import (C, SDL_WM_GetCaption, "SDL_WM_GetCaption");

  -- * Sets the icon for the display window.
  -- * This function must be called before the first call to SDL_SetVideoMode().
  -- * It takes an icon surface, and a mask in MSB format.
  -- * If 'mask' is NULL, the entire icon surface will be used as the icon.
  --

   procedure SDL_WM_SetIcon (icon : Sdl_Surface; mask : access SDL_stdinc_h.Uint8);  -- SDL_video.h:838:75
   pragma Import (C, SDL_WM_SetIcon, "SDL_WM_SetIcon");

  -- * This function iconifies the window, and returns 1 if it succeeded.
  -- * If the function succeeds, it generates an SDL_APPACTIVE loss event.
  -- * This function is a noop and returns 0 in non-windowed environments.
  --

   function SDL_WM_IconifyWindow return int;  -- SDL_video.h:845:54
   pragma Import (C, SDL_WM_IconifyWindow, "SDL_WM_IconifyWindow");

  -- * Toggle fullscreen mode without changing the contents of the screen.
  -- * If the display surface does not require locking before accessing
  -- * the pixel information, then the memory pointers will not change.
  -- *
  -- * If this function was able to toggle fullscreen mode (change from
  -- * running in a window to fullscreen, or vice-versa), it will return 1.
  -- * If it is not implemented, or fails, it returns 0.
  -- *
  -- * The next call to SDL_SetVideoMode() will set the mode fullscreen
  -- * attribute based on the flags parameter - if SDL_FULLSCREEN is not
  -- * set, then the display will be windowed by default where supported.
  -- *
  -- * This is currently only implemented in the X11 video driver.
  --

   function SDL_WM_ToggleFullScreen (surface : Sdl_Surface) return int;  -- SDL_video.h:862:73
   pragma Import (C, SDL_WM_ToggleFullScreen, "SDL_WM_ToggleFullScreen");

  -- * This function allows you to set and query the input grab state of
  -- * the application.  It returns the new input grab state.
  --

  -- Used internally
   subtype SDL_GrabMode is unsigned;
   SDL_GRAB_QUERY : constant SDL_GrabMode := -1;
   SDL_GRAB_OFF : constant SDL_GrabMode := 0;
   SDL_GRAB_ON : constant SDL_GrabMode := 1;
   SDL_GRAB_FULLSCREEN : constant SDL_GrabMode := 2;  -- SDL_video.h:873:3

  -- * Grabbing means that the mouse is confined to the application window,
  -- * and nearly all keyboard input is passed directly to the application,
  -- * and not interpreted by a window manager, if any.
  --

   function SDL_WM_GrabInput (mode : SDL_GrabMode) return SDL_GrabMode;  -- SDL_video.h:879:72
   pragma Import (C, SDL_WM_GrabInput, "SDL_WM_GrabInput");

  -- Not in public API at the moment - do not use!
   function SDL_SoftStretch
     (src : Sdl_Surface;
      srcrect : access SDL_Rect;
      dst : Sdl_Surface;
      dstrect : access SDL_Rect) return int;  -- SDL_video.h:883:72
   pragma Import (C, SDL_SoftStretch, "SDL_SoftStretch");

  -- Ends C function definitions when using C++
end SDL_video_h;
